<template>
    <view class="com-balance">
        <view class="b-box">
            <view class="title">我的订单</view>
            <view class="s-box">
                <view class="s-item" @click="go(`/pages-order/list/list?state=0`)">
                    <text class="cuIcon cuIcon-newshot s-icon"></text>
                    <view class="s-txt">全部</view>
                </view>
                <view class="s-item" @click="go(`/pages-order/list/list?state=1`)">
                    <text class="cuIcon cuIcon-pay s-icon"></text>
                    <view class="s-txt">待付款</view>
                </view>
                <view class="s-item" @click="go(`/pages-order/list/list?state=2`)">
                    <text class="cuIcon cuIcon-deliver s-icon"></text>
                    <view class="s-txt">待发货</view>
                </view>
                <view class="s-item" @click="go(`/pages-order/list/list?state=3`)">
                    <text class="cuIcon cuIcon-pick s-icon"></text>
                    <view class="s-txt">待收货</view>
                </view>
                <view class="s-item" @click="go(`/pages-order/refund/list`)">
                    <text class="cuIcon cuIcon-refund s-icon"></text>
                    <view class="s-txt">售后/退款</view>
                </view>
            </view>
        </view>
    </view>
</template>

<script setup>
const {
    proxy
} = getCurrentInstance()

const props = defineProps({
    sta_info: {
        type: [Object],
        default: {}
    }
})

function go(url) {
    if (!proxy.$store.token) {
        proxy.$go('/pages/login/login')
        return
    }
    proxy.$go(url)
}
</script>

<style lang="scss" scoped>
.com-balance {
    width: 100%;
    height: auto;
    padding: 0 20rpx 20rpx;
    position: relative;
    z-index: 2;

    .b-box {
        width: 100%;
        padding: 30rpx;
        background: #fff;
        border-radius: 20rpx;

        .title {
            font-size: 30rpx;
            font-weight: 500;
            color: #000;

        }

        .s-box {
            width: 100%;
            height: auto;
            display: flex;
            flex-wrap: wrap;
            align-items: center;

            .s-item {
                width: 20%;
                height: auto;
                display: flex;
                align-items: center;
                justify-content: center;
                flex-direction: column;
                padding-top: 30rpx;

                .s-icon {
                    width: 52rpx;
                    height: 52rpx;
                    font-size: 52rpx;
                    color: $main_color;
                }

                .s-txt {
                    font-size: 24rpx;
                    color: #666;
                    margin-top: 10rpx;
                }
            }
        }
    }
}
</style>
